package com.zrrd.learn.framework.springframework.core.official.javabase;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author wrn
 * @version 1.0
 * @date 2023/9/14 14:32
 */

public class AnnotationDemo {

    public static void main(String[] args) {
        //        实例化  注解的容器
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();

        // 把pear注入到容器作为组件
        context.register(SpringConfiguration.class);
//        context.scan("com.ftg.learn");

        //刷新容器缓存
        context.refresh();

        Pear bean = context.getBean(Pear.class);
        System.out.println(bean.getType());
    }

}
